<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<title>自由课程中的作业详情</title>
<link rel="stylesheet" href="../../css/mui.min.css" />
		<link rel="stylesheet" href="../../css/timecontrol.min.css" />
<!--		<link rel="stylesheet" href="../../css/CFNetPP_Base.css">-->
		<link rel="stylesheet" href="../../css/base.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/weui.min.css">
		<script src="../../script/ui.js"></script>

		<style>
			body {
				background-color: #FFFFFF
			}
			html {
				background-color: #FFFFFF
			}
			.clearfix {
				content: '';
				display: block;
				clear: both;
			}
			.line_heigt_px {
				line-height: 1.2em;
			}
			.content_div {
				background: #fff;
				margin-top: 66px;
			}
			.padding10 {
				padding-left: 10px;
				padding-top: 10px;
				padding-right: 10px;
			}
			.div_left_none {
				padding-left: 10px;
				display: none;
			}
			.sore_text_style {
				width: 80px;
				height: 30px;
				color: red;
			}
		</style>
	</head>
	<body>
		<div class="base_style_color" id='BarAppearance' ></div>
		<div class="base_navigation_bar base_style_color">
			<a class="base_left_item" href="#" onclick="backClick()"> <img class="base_back_icon"
																		   src="../../image/icon_jiantou.png" alt=""> </a>
			<span id='nav_title'>作业</span>
			<a class="base_right_item base_hide_item"></a>
		</div>
		<div class="content_div" hidden="hidden" >
			<div id="bewriteDIV" hidden="hidden">
				<div class="padding10">
					<p class=" base_black_grey base_title_font">
						描述
					</p>
					<div class="base_dark_grey base_content_font according-2-rows text_indent_2" id="bewrite" onclick="openBewrite()">
						描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字描述文字
					</div>
				</div>
				<div class="div_divider"></div>
				<div style="background-color: #f0f0f0;height:5px"></div>
				<div class="div_divider"></div>
			</div>
			<div class="padding10">
				<p class=" base_black_grey base_title_font">
					作业提交时间:
				</p>
				<div class="  base_dark_grey base_content_font">
					开始时间 :<em id="stateTime">1111111</em>
				</div>
				<div class="  base_dark_grey base_content_font">
					结束 时间:<em id="endTime">333</em>
				</div>
			</div>
			<div class="div_divider"></div>
			<div style="background-color: #f0f0f0;height:5px"></div>
			<div class="div_divider"></div>
			<div class="padding10">
				<p class=" base_black_grey base_title_font">
					提交方式
				</p>
				<div class="  base_dark_grey base_content_font" id="leader">
					小组提交
				</div>
			</div>
			<div class="div_divider"></div>
			<div style="background-color: #f0f0f0;height:5px"></div>
			<div class="div_divider"></div>
			<div class="padding10">
				<p class=" base_black_grey base_title_font">
					审核人
				</p>
				<div class="  base_dark_grey base_content_font Word_wrap " id="Usernum">
					米绒绒，历史
				</div>
			</div>
		</div>
		<div class="noSign" hidden="hidden" id="noData" style="margin-top: 60px;">
			<img src="../../image/icon_img.png" width="60%">
			<p class="font16 top_15 base_dark_grey" >
				暂无数据
			</p>
		</div>
		<div class="loadFailure" hidden="hidden" id="noNet" style="margin-top: 60px;">
			<img src="../../image/icon_img01.png" width="60%">
			<p class="" >
				数据加载失败
			</p>
			<p>
				请检查您的网络
			</p>
			<button type="button"  onclick="loadData()"class="mui-btn mui-btn-outlined">
				重新加载
			</button>
		</div>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/MD5.js"></script>
	<script src="../../script/common.js"></script>
	<script src="../../script/timeStampTool.js"></script>
	<script src="../../script/processing_images.js"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script src="../../script/attachmentManager.js"></script>
	<script type="text/javascript" src="../../script/jquery.min.js"></script>
	<script type="text/javascript" src="../../script/databaseOperation.js"></script>
	<script type="text/javascript">
		var pageParam;
		var pid = "";
		var vid = "";
		var uid = "";
		var jid = "";
		var studyid = '';
		var wid = '';
		DBReady = function() {
			initHeaderUI();
			showProgress();
			bewrite();
			getpageParamdata();
			getloadData();
			sendBuriedNotifi(0, '老师查看作业信息', '073');
		};
		
		
		
			
	function sendBuriedNotifi(busionessid, pagetype, pagetypeid) {
			var userinfo = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjxid'),
				uname : $api.getStorage('cfnetppusername'),
				cid : api.pageParam.cid,
				pid : api.pageParam.pid,
				vid : api.pageParam.vid
			}
			var data = {
				busionessid : busionessid,
				pagetype : pagetype,
				pagetypeid : pagetypeid,
				sourceurl : api.pageParam.sourceurl,
				sourcetitle : api.pageParam.sourcetitle,
				accesspageurl : window.location.pathname,
				accesspagetitle : document.title,
				userinfo : userinfo
			}
			SendBehaviorTrajectoriesNotifi_Study(data);
		}
		
		
		function bewrite() {
			pageParam = api.pageParam;
			$('#nav_title').html(pageParam.cdetailtitle);
			var bewrite = pageParam.bewrite;
			  if (bewrite  != "" && bewrite  != null && bewrite  != undefined) {
			        $('#bewriteDIV').show();
			      
			        if(removeHTMLTag(bewrite).length>0){
					 $('#bewrite').text(removeHTMLTag(bewrite));
					}else{
					 $('#bewrite').text('点击查看详情');
					}
				}
			}

			function getpageParamdata() {
				cid = pageParam.cid, 
				vid = pageParam.vid, 
				pid = pageParam.pid, 
				wid = pageParam.wid, 
				studyid = pageParam.studyid
			}

		// 预览作业
		function getloadData() {
			var params = {
				jid : $api.getStorage('cfnetppjxid'),
				uid : $api.getStorage('cfnetppuid'),
				cid : cid,
				vid : vid,
				pid : pid,
				wid : wid,
			};
//						alert(JSON.stringify(params));
			cfnetppPOST(url_WorkPreview, params, true, function(data, status) {
				api.hideProgress();
//				alert(url_WorkPreview);
//				alert(JSON.stringify(data));
				if (status == 'success') {
					if (data.code == 200) {
						var datajson = data.data;
//							alert(JSON.stringify(datajson));
						if (datajson != '') {
						$('.content_div').show();
							$('#noData').hide();
							$('#noNet').hide();
							setdata(datajson);
						} else {
							$('#noData').show();
							$('#noNet').hide();
						}
					} else if (data.code = 109) {
						$('#noData').show();
						$('#noNet').hide();
					} else {
						$('#noData').show();
						$('#noNet').hide();
					}
				} else {
					$('#noData').hide();
					$('#noNet').show();
				}
			});
		}

		function setdata(data) {
			
		
			$('#stateTime').text(timeStringWithTimeStamp(data.stime.toString()));
			$('#endTime').text(timeStringWithTimeStamp(data.etime.toString()));
			if(data.leader == 0){
			  $('#leader').text("个人");
			}else{
			 $('#leader').text("小组为单位");
			}
			var user = data.user;
			var users ='';
			for(i=0;i<user.length;i++){
			users = users+user[i].rename+",";
			}

			$('#Usernum').text(users.substring(0, users.length-1));
		}

		function backClick() {
			sendBuriedNotifi(1, '老师查看作业信息', '073');
			api.closeWin({
			});
		}
		//描述
			function openBewrite(){
			api.openWin({useWKWebView:true,
			    name: 'Student_Free_bewrite',
			    url: '../Study/Student_Free_bewrite.html',
			    pageParam: {
			      cdetailtitle : pageParam.cdetailtitle,
					bewrite : api.pageParam.bewrite,
					is_dis_bewrite : api.pageParam.is_dis_bewrite
			    }
			});
		}
	</script>
</html>